#include <iostream>
#include "tcp_server.hpp"
#include <memory>

static void usage(std::string proc)
{
    std::cout << "\nUsage: " << proc << " port" << std::endl;
}

int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        usage(argv[0]);
        exit(1);
    }

    uint16_t port = atoi(argv[1]); // 把一个字符串转换成一个整型数据
    std::unique_ptr<TcpServer> ser(new TcpServer(port));
    std::unique_ptr<TcpServer> rec(new TcpServer(port));

    ser->initServer();

    ser->start();
    return 0;
}